<template>
  <!-- 顶部 -->
  <div class="top">
    <van-nav-bar
      title="驾驶证信息"
      left-text="返回"
      right-text="首页"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <div v-for="item in licenses" :key="item.id">
      <p>驾驶证号:{{ item.licenseNo }}</p>
      <p>准驾车型:{{ item.licenseLevel }}</p>
      <p>申领日期:{{ item.applyDate }}</p>
      <p>驾驶有效期:{{ item.verifyDate }}</p>
      <p>是否过期:{{ item.timeout }}</p>
     <br />
      <van-divider />
    </div>
  </div>
</template>

<script>
// import { Toast } from "vant";
import nav from "../../../mixin/nav";
import { GetLicense } from "@/service/traffic/traffic";

export default {
  mixins: [nav],
  data() {
    return {
      licenses: {},
    };
  },
  methods: {
    //头部方法
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {
      this.$router.push("/");
    },
  },
  async mounted() {
    let token = window.localStorage.getItem("token");
    if (token) {
      let { data } = await GetLicense();
      // console.log({ data });
        if ({data}.data.code == 200) {
         this.licenses = { data }.data.data;
      //   console.log(this.licenses);
     }
    }
  },
};
</script>

<style>
</style>